<?php
require_once "Common/database.php";
require_once "Common/values.php";
echo '<h3>Log Search<p></h3>';
#echo '<p> User : '.$user ;

if($_POST[status]=='!Closed')
{
$result = mysql_query("SELECT * FROM tblJobsA WHERE status != 'Closed' AND LogNumber LIKE '$_POST[lognumber]' AND Operator LIKE '$_POST[operator]' AND Requestor LIKE '$_POST[requestor]' AND Subject LIKE '$_POST[subject]' AND Proirty LIKE '$_POST[proirty]' AND Time LIKE '$_POST[time]' AND Date LIKE '$_POST[date]' AND Branch LIKE '$_POST[branch]' AND Department LIKE '$_POST[department]' AND Due LIKE '$_POST[due]' AND Phone LIKE '$_POST[phone]' AND VNC LIKE '$_POST[vnc]'");
#echo $result;
}
else
{
$result = mysql_query("SELECT * FROM tblJobsA WHERE status LIKE '$_POST[status]' AND LogNumber LIKE '$_POST[lognumber]' AND Operator LIKE '$_POST[operator]' AND Requestor LIKE '$_POST[requestor]' AND Subject LIKE '$_POST[subject]' AND Proirty LIKE '$_POST[proirty]' AND Time LIKE '$_POST[time]' AND Date LIKE '$_POST[date]' AND Branch LIKE '$_POST[branch]' AND Department LIKE '$_POST[department]' AND Due LIKE '$_POST[due]' AND Phone LIKE '$_POST[phone]' AND VNC LIKE '$_POST[vnc]'");
#echo $result;
}

echo '<Table Border = 1 width=100%>';
echo '<tr><td>Log Number</td><td>Operator</td><td>Requestor</td><td>Subject</td></td><td>Proirty</td></td><td>Status</td></tr>';
while($row = mysql_fetch_array($result))
  {

  echo '<tr><td><a href=index.php?p=hupdate&log='.$row['LogNumber'] .'>'.$row['LogNumber']. "</td><td>" . $row['Operator'].'</td>'.'<td>'.$row['Requestor'].'</td><td>'.$row[Subject].'</td>'.'<td>'.$row[Proirty].'</td>'.'<td>'.$row[Status].'</td>'.'</td></tr>';
  
  }
echo '</table>';
mysql_close();
?>